<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@ taglib prefix="s" uri="/struts-tags" %>
<%@ page import="java.util.ArrayList,edu.student.models.*, com.opensymphony.xwork2.ActionContext,java.util.Map,java.util.List" %>

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
<script language="javascript">
function doValidation() {
	var semester=document.getElementById("semester").value;
	var course=document.getElementById("course").value;
	if (semester==""){
		alert("Semester field is manadtaory.Please enter appropriately");
		return false;
	}
	if (course==""){
		alert("Course field is manadtaory.Please enter appropriately");
		return false;
	}
	return true;
}
</script>
</head>
<body>
<h2>Create Syllabus for Courses</h2>
<s:form action="AdminSyllabus">
<table id="text" align="center">
<tr>
<td><s:select label="Select Course" headerKey="" headerValue="-none-" list="courseList" listvalue="name" key="CourseName" id="course" style="width: 150px"></s:select></td>
</tr>

<tr>
<td><s:textfield label="Chapter Name" key="ChapterName" ></s:textfield></td>
</tr>

<tr></tr>
<tr>
<td><s:submit name="commandButton" value="Add Syllabus" id = "mysubmit"  style="height: 30px; width: 200px" >
</s:submit></td>
<td><s:submit name = "commandButton" value="View Syllabus" id = "mysubmit" style="height: 30px; width: 200px" onclick="return doValidation()">
</s:submit></td>
</tr>
</table>
<table >
<s:form action="back" align="right" name = "Back">
<tr><td><center>
<s:submit name = "commandButton" value="Back to Admin Home" id = "mysubmit" style="height: 30px; width: 200px">
</s:submit></center></td></tr></s:form>
</table>
</s:form>

</body>
</html>